import { ref } from "vue";
import { defineStore } from "pinia";

export const useUserInfoStore = defineStore(
  "userInfo",
  () => {
    const userInfo = ref(null);
    const setUserInfo = (data) => {
      userInfo.value = data;
    };
    const removeUserInfo = () => {
      userInfo.value = null;
    };

    return { userInfo, setUserInfo, removeUserInfo };
  },
  {
    persist: true,
  }
);
